﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BrandManager.ascx.cs" Inherits="UserControl_BrandManager" %>
<script type="text/javascript">
    function ViewDetail(element, id) {
        alert(element +'- '+id);
        jQuery('#'+element).html(id);
        jQuery('#' + element).fancybox({
            'titlePosition': 'inside',
            'transitionIn': 'none',
            'transitionOut': 'none'
        });
    }
    jQuery(document).ready(function () {
        jQuery(".fancyboxtag").click(function () {
            jQuery('#UpgradeBrand').fancybox({
                'titlePosition': 'inside',
                'transitionIn': 'none',
                'transitionOut': 'none'
            });
            alert('xxx');
            return false;
        });
    });
</script>
<asp:GridView ID="grvBrandManager" runat="server" AutoGenerateColumns="false"  onrowdatabound="grvBrandManager_RowDataBound" OnRowCommand="grvBrandManager_RowCommand" 
    AllowPaging="true" PageSize="20" Width="97%" CssClass="tableStyle" OnPageIndexChanging="grvBrandManager_PageIndexChanging" >
    <Columns>
        <asp:TemplateField ItemStyle-Width="25%" HeaderText="Tên thuơng hiệu">
            <ItemTemplate>
                <%#Eval("name") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" HeaderText="Ngày tạo">
            <ItemTemplate>
                <%#DateTime.Parse(Eval("date_created").ToString()).ToString("dd-mm-yyyy") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ItemStyle-Width="15%" HeaderText="Logo">
            <ItemTemplate>
                <img width="100" height="100"  src='<%# "uploads/" + Eval("logo") %>' alt='<%#Eval("name") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ItemStyle-Width="15%" HeaderText="Loại DN">
            <ItemTemplate>
                <asp:Literal runat="server" ID="Literal_Status" Text='<%#Eval("isVip") %>'></asp:Literal>
            </ItemTemplate>
        </asp:TemplateField>            
        <asp:TemplateField ItemStyle-Width="15%" HeaderText="Trạng thái">
            <ItemTemplate>
                <asp:Literal runat="server" ID="Literal_Check" Text='<%#Eval("isCheck") %>'></asp:Literal>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ItemStyle-Width="35%" ItemStyle-HorizontalAlign="Center" HeaderText="Tùy chọn">
            <ItemTemplate>
                <a href="javascript:void(0);" class="fancyboxtag"><span title="Xem chi tiết" style="background: url(images/16x16-icons.png) no-repeat -512px -53px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a>
                <%--<a href="#"><span title="Chỉnh sửa" style="background: url(../images/16x16-icons.png) no-repeat -286px -2px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a>--%>
                <a href="#"><span title="Nâng cấp VIP" style="background: url(images/16x16-icons.png) no-repeat -261px -77px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a>
                <asp:ImageButton ID="btndelete" runat="server" ImageUrl="~/images/Delete.png" CommandName="deleteInbox" title="Xóa" 
                    CommandArgument='<%#Eval("Id") %>' OnClientClick="return confirm('Bạn có chắc muốn xóa không ?');" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        <b>No Email here</b>
    </EmptyDataTemplate>
    <PagerSettings PageButtonCount="50" Position="Bottom" />
</asp:GridView>
<div id="UpgradeBrand" style="width:500px; height: 500px; display: none">
    <img alt="example1" src="images/banners/18_14_13_45_Desert.jpg" />
</div>